home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
mkdata.arc
/
DG.DAT
next >
Wrap
Text File
|
1991-04-28
|
29KB
|
634 lines
program <PROCESS>;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<PROCESS> : Generated by DataGen
Copyright (C) January, 1988
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
uses crt, dos, TAccess, io;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<PROCESS> data structure definition section
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
{$I <PROCESS>.typ}
var <PROCESS>_data : <PROCESS>_structure;
<PROCESS>_file : datafile;
<IF_IX1>index1 : indexfile;
<IF_IX2>index2 : indexfile;
<IF_IX3>index3 : indexfile;
<IF_IX4>index4 : indexfile;
<IF_IX5>index5 : indexfile;
<IF_IX6>index6 : indexfile;
<IF_IX7>index7 : indexfile;
<IF_IX8>index8 : indexfile;
<IF_IX9>index9 : indexfile;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<PROCESS> global variable declarations.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
const NEW_<PROCESS> = -1;
var <PROCESS>_record : longint;
search_index : longint;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<PROCESS> screen definition file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
{$I <PROCESS>.scr}
{
*-----------------------------------------------------------------------*
function upper_case
*-----------------------------------------------------------------------*
}
function upper_case(in_string : medium_string ) : medium_string;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Accepts lower case string, returns upper case string as value of the
function.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
var out_string : medium_string;
i : byte;
begin
out_string := '';
for i := 1 to length( in_string ) do
out_string := out_string + upcase( in_string[i] );
upper_case := out_string;
end; {function upper_case}
{
*-----------------------------------------------------------------------*
procedure rebuild_index
*-----------------------------------------------------------------------*
}
procedure rebuild_index;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rebuilds the indices.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
var record_number : longint;
key_to_add : medium_string;
begin
initindex;
message('Building Index files...',1);
<IF_IX1>makeindex( index1, '<PROCESS>.ix1', sizeof(<PROCESS>_data.<IX1>)-1, 1 );
<IF_IX2>makeindex( index2, '<PROCESS>.ix2', sizeof(<PROCESS>_data.<IX2>)-1, 1 );
<IF_IX3>makeindex( index3, '<PROCESS>.ix3', sizeof(<PROCESS>_data.<IX3>)-1, 1 );
<IF_IX4>makeindex( index4, '<PROCESS>.ix4', sizeof(<PROCESS>_data.<IX4>)-1, 1 );
<IF_IX5>makeindex( index5, '<PROCESS>.ix5', sizeof(<PROCESS>_data.<IX5>)-1, 1 );
<IF_IX6>makeindex( index6, '<PROCESS>.ix6', sizeof(<PROCESS>_data.<IX6>)-1, 1 );
<IF_IX7>makeindex( index7, '<PROCESS>.ix7', sizeof(<PROCESS>_data.<IX7>)-1, 1 );
<IF_IX8>makeindex( index8, '<PROCESS>.ix8', sizeof(<PROCESS>_data.<IX8>)-1, 1 );
<IF_IX9>makeindex( index9, '<PROCESS>.ix9', sizeof(<PROCESS>_data.<IX9>)-1, 1 );
for record_number := 1 to filelen(<PROCESS>_file) - 1 do begin
getrec(<PROCESS>_file,record_number,<PROCESS>_data);
if <PROCESS>_data.status = 0 then begin
<IF_IX1> key_to_add := upper_case(<PROCESS>_data.<IX1>);
<IF_IX1> addkey( index1, record_number, key_to_add );
<IF_IX2>
<IF_IX2> key_to_add := upper_case(<PROCESS>_data.<IX2>);
<IF_IX2> addkey( index2, record_number, key_to_add);
<IF_IX3>
<IF_IX3> key_to_add := upper_case(<PROCESS>_data.<IX3>);
<IF_IX3> addkey( index3, record_number, key_to_add);
<IF_IX4>
<IF_IX4> key_to_add := upper_case(<PROCESS>_data.<IX4>);
<IF_IX4> addkey( index4, record_number, key_to_add);
<IF_IX5>
<IF_IX5> key_to_add := upper_case(<PROCESS>_data.<IX5>);
<IF_IX5> addkey( index5, record_number, key_to_add);
<IF_IX6>
<IF_IX6> key_to_add := upper_case(<PROCESS>_data.<IX6>);
<IF_IX6> addkey( index6, record_number, key_to_add);
<IF_IX7>
<IF_IX7> key_to_add := upper_case(<PROCESS>_data.<IX7>);
<IF_IX7> addkey( index7, record_number, key_to_add);
<IF_IX8>
<IF_IX8> key_to_add := upper_case(<PROCESS>_data.<IX8>);
<IF_IX8> addkey( index8, record_number, key_to_add);
<IF_IX9>
<IF_IX9> key_to_add := upper_case(<PROCESS>_data.<IX9>);
<IF_IX9> addkey( index9, record_number, key_to_add);
end; {if}
end; {for}
message('Index Files Rebuilt.',1);
end { rebuild_index };
{
*-----------------------------------------------------------------------*
procedure open_<PROCESS>
*-----------------------------------------------------------------------*
}
function open_<PROCESS> : boolean;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Opens files and returns true, false if user wants to QUIT.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
begin
open_<PROCESS> := true;
OpenFile( <PROCESS>_file, '<PROCESS>.dat', sizeof( <PROCESS>_data ));
if not ok then begin
message('WELCOME TO <PROCESS>',1);
if get_menu('\1Yes\2Quit','',1,'\qFILES NOT FOUND, INITIALIZE? :') = 1 then begin
makefile( <PROCESS>_file, '<PROCESS>.dat',sizeof(<PROCESS>_data));
<IF_IX1> makeindex( index1, '<PROCESS>.ix1',sizeof( <PROCESS>_data.<IX1>)-1,1);
<IF_IX2> makeindex( index2, '<PROCESS>.ix2',sizeof( <PROCESS>_data.<IX2>)-1,1);
<IF_IX3> makeindex( index3, '<PROCESS>.ix3',sizeof( <PROCESS>_data.<IX3>)-1,1);
<IF_IX4> makeindex( index4, '<PROCESS>.ix4',sizeof( <PROCESS>_data.<IX4>)-1,1);
<IF_IX5> makeindex( index5, '<PROCESS>.ix5',sizeof( <PROCESS>_data.<IX5>)-1,1);
<IF_IX6> makeindex( index6, '<PROCESS>.ix6',sizeof( <PROCESS>_data.<IX6>)-1,1);
<IF_IX7> makeindex( index7, '<PROCESS>.ix7',sizeof( <PROCESS>_data.<IX7>)-1,1);
<IF_IX8> makeindex( index8, '<PROCESS>.ix8',sizeof( <PROCESS>_data.<IX8>)-1,1);
<IF_IX9> makeindex( index9, '<PROCESS>.ix9',sizeof( <PROCESS>_data.<IX9>)-1,1);
end {if}
else open_<PROCESS> := false;
exit;
end {if}
else begin
<IF_IX1> openindex(index1, '<PROCESS>.ix1', sizeof( <PROCESS>_data.<IX1>)-1,1 );
<IF_IX2> openindex(index2, '<PROCESS>.ix2', sizeof( <PROCESS>_data.<IX2>)-1,1 );
<IF_IX3> openindex(index3, '<PROCESS>.ix3', sizeof( <PROCESS>_data.<IX3>)-1,1 );
<IF_IX4> openindex(index4, '<PROCESS>.ix4', sizeof( <PROCESS>_data.<IX4>)-1,1 );
<IF_IX5> openindex(index5, '<PROCESS>.ix5', sizeof( <PROCESS>_data.<IX5>)-1,1 );
<IF_IX6> openindex(index6, '<PROCESS>.ix6', sizeof( <PROCESS>_data.<IX6>)-1,1 );
<IF_IX7> openindex(index7, '<PROCESS>.ix7', sizeof( <PROCESS>_data.<IX7>)-1,1 );
<IF_IX8> openindex(index8, '<PROCESS>.ix8', sizeof( <PROCESS>_data.<IX8>)-1,1 );
<IF_IX9> openindex(index9, '<PROCESS>.ix9', sizeof( <PROCESS>_data.<IX9>)-1,1 );
end; {else}
end; {function open_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure close_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure close_<PROCESS>;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
closes the <PROCESS> data and index files.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
begin
closefile( <PROCESS>_file );
<IF_IX1> closeindex( index1 );
<IF_IX2> closeindex( index2 );
<IF_IX3> closeindex( index3 );
<IF_IX4> closeindex( index4 );
<IF_IX5> closeindex( index5 );
<IF_IX6> closeindex( index6 );
<IF_IX7> closeindex( index7 );
<IF_IX8> closeindex( index8 );
<IF_IX9> closeindex( index9 );
end; {procedure close_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure retrieve_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure retrieve_<PROCESS>( param : byte ) ;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Brings in the next, previous, first, last record based on param.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
var recnum : longint;
key_to_search : long_string;
begin
if param in [1,2] then case search_index of
<IF_IX1> <IXLOC1> : clearkey( index1 );
<IF_IX2> <IXLOC2> : clearkey( index2 );
<IF_IX3> <IXLOC3> : clearkey( index3 );
<IF_IX4> <IXLOC4> : clearkey( index4 );
<IF_IX5> <IXLOC5> : clearkey( index5 );
<IF_IX6> <IXLOC6> : clearkey( index6 );
<IF_IX7> <IXLOC7> : clearkey( index7 );
<IF_IX8> <IXLOC8> : clearkey( index8 );
<IF_IX9> <IXLOC9> : clearkey( index9 );
end; {case}
if param in [1,3] then case search_index of
<IF_IX1> <IXLOC1>: nextkey( index1, recnum, key_to_search );
<IF_IX2> <IXLOC2>: nextkey( index2, recnum, key_to_search );
<IF_IX3> <IXLOC3>: nextkey( index3, recnum, key_to_search );
<IF_IX4> <IXLOC4>: nextkey( index4, recnum, key_to_search );
<IF_IX5> <IXLOC5>: nextkey( index5, recnum, key_to_search );
<IF_IX6> <IXLOC6>: nextkey( index6, recnum, key_to_search );
<IF_IX7> <IXLOC7>: nextkey( index7, recnum, key_to_search );
<IF_IX8> <IXLOC8>: nextkey( index8, recnum, key_to_search );
<IF_IX9> <IXLOC9>: nextkey( index9, recnum, key_to_search );
end; {case}
if param in [2,4] then case search_index of
<IF_IX1> <IXLOC1>: prevkey( index1, recnum, key_to_search );
<IF_IX2> <IXLOC2>: prevkey( index2, recnum, key_to_search );
<IF_IX3> <IXLOC3>: prevkey( index3, recnum, key_to_search );
<IF_IX4> <IXLOC4>: prevkey( index4, recnum, key_to_search );
<IF_IX5> <IXLOC5>: prevkey( index5, recnum, key_to_search );
<IF_IX6> <IXLOC6>: prevkey( index6, recnum, key_to_search );
<IF_IX7> <IXLOC7>: prevkey( index7, recnum, key_to_search );
<IF_IX8> <IXLOC8>: prevkey( index8, recnum, key_to_search );
<IF_IX9> <IXLOC9>: prevkey( index9, recnum, key_to_search );
end; {case}
if ok then begin
getrec(<PROCESS>_file, recnum, <PROCESS>_data);
<PROCESS>_record := recnum;
<PROCESS>_screen('\2');
end {if}
else message('NO RECORD',1);
end; {procedure retrieve_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure find_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure find_<PROCESS>;
var recnum : longint;
key_to_search : long_string;
begin
if usedrecs( <PROCESS>_file ) = 0 then begin
message('ERROR : FILE IS EMPTY',2);
exit;
end;
case get_menu('\1First\2Last\3Search\4Rebuild\5Exit',
'\1First Record\2Last Record\3Search by Index\4Rebuild Index files',1,'\qOPTION : ') of
1: retrieve_<PROCESS>(1);
2: retrieve_<PROCESS>(2);
3: begin
fillchar(<PROCESS>_data, sizeof(<PROCESS>_data), 0);
<PROCESS>_screen('\2\3\index');
case search_index of
<IF_IX1> <IXLOC1> : begin key_to_search := upper_case(<PROCESS>_data.<IX1>);
<IF_IX1> searchkey( index1, recnum, key_to_search);
<IF_IX1> end;
<IF_IX2>
<IF_IX2> <IXLOC2> : begin key_to_search := upper_case(<PROCESS>_data.<IX2>);
<IF_IX2> searchkey( index2, recnum, key_to_search);
<IF_IX2> end;
<IF_IX3>
<IF_IX3> <IXLOC3> : begin key_to_search := upper_case(<PROCESS>_data.<IX3>);
<IF_IX3> searchkey( index3, recnum, key_to_search);
<IF_IX3> end;
<IF_IX4>
<IF_IX4> <IXLOC4> : begin key_to_search := upper_case(<PROCESS>_data.<IX4>);
<IF_IX4> searchkey( index4, recnum, key_to_search);
<IF_IX4> end;
<IF_IX5>
<IF_IX5> <IXLOC5> : begin key_to_search := upper_case(<PROCESS>_data.<IX5>);
<IF_IX5> searchkey( index5, recnum, key_to_search);
<IF_IX5> end;
<IF_IX6>
<IF_IX6> <IXLOC6> : begin key_to_search := upper_case(<PROCESS>_data.<IX6>);
<IF_IX6> searchkey( index6, recnum, key_to_search);
<IF_IX6> end;
<IF_IX7>
<IF_IX7> <IXLOC7> : begin key_to_search := upper_case(<PROCESS>_data.<IX7>);
<IF_IX7> searchkey( index7, recnum, key_to_search);
<IF_IX7> end;
<IF_IX8>
<IF_IX8> <IXLOC8> : begin key_to_search := upper_case(<PROCESS>_data.<IX8>);
<IF_IX8> searchkey( index8, recnum, key_to_search);
<IF_IX8> end;
<IF_IX9>
<IF_IX9> <IXLOC9> : begin key_to_search := upper_case(<PROCESS>_data.<IX9>);
<IF_IX9> searchkey( index9, recnum, key_to_search);
<IF_IX9> end;
end; {case}
if ok then begin
getrec( <PROCESS>_file, recnum, <PROCESS>_data);
<PROCESS>_record := recnum;
<PROCESS>_screen('\2');
end {if}
else retrieve_<PROCESS>(2);
end; {case 3}
4: rebuild_index;
5: ;
end; {case}
end; {procedure find_<PROCESS>}
{
*---------------------------------------------------------------------*
procedure fill_<PROCESS>
*---------------------------------------------------------------------*
}
function fill_<PROCESS> : byte;
var select : integer;
<PROCESS>_save : <PROCESS>_structure;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Allows the user to Alter the contents of a passed <PROCESS> record.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
begin
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Save the old record in case they cancel session.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
<PROCESS>_save := <PROCESS>_data;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New record? blank out the data structure.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
if <PROCESS>_record = NEW_<PROCESS> then begin
fillchar( <PROCESS>_data, sizeof( <PROCESS>_data ), 0 );
<PROCESS>_screen( '\2' ); {blank out the fields}
end; {if}
<PROCESS>_screen('\3'); {permit filling of fields}
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permit the user to fill the <PROCESS> structure.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
select :=2;
repeat
select := get_menu('\1Edit\2Save\3Cancel',
'\1Edit Screen Information\2Save Data\3Cancel & Return',
select, '\qEDIT OPTION: ');
fill_<PROCESS> := select;
case select of
1: <PROCESS>_screen('\3');
2: exit;
3: begin
<PROCESS>_data := <PROCESS>_save;
<PROCESS>_screen('\2');
exit;
end;
end; {case}
until false;
end; {procedure fill_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure delete_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure delete_<PROCESS>;
var key_to_delete : medium_string;
begin
if <PROCESS>_record = NEW_<PROCESS> then begin
message('Please Select a Record for Deletion',2);
exit;
end;
if get_menu('\1Yes\2Cancel','',1,'\qDELETE CURRENT RECORD? : ') = 1
then begin
<IF_IX1> key_to_delete := upper_case(<PROCESS>_data.<IX1>);
<IF_IX1> deletekey( index1, <PROCESS>_record, key_to_delete);
<IF_IX2>
<IF_IX2> key_to_delete := upper_case(<PROCESS>_data.<IX2>);
<IF_IX2> deletekey( index2, <PROCESS>_record, key_to_delete);
<IF_IX3>
<IF_IX3> key_to_delete := upper_case(<PROCESS>_data.<IX3>);
<IF_IX3> deletekey( index3, <PROCESS>_record, key_to_delete);
<IF_IX4>
<IF_IX4> key_to_delete := upper_case(<PROCESS>_data.<IX4>);
<IF_IX4> deletekey( index4, <PROCESS>_record, key_to_delete);
<IF_IX5>
<IF_IX5> key_to_delete := upper_case(<PROCESS>_data.<IX5>);
<IF_IX5> deletekey( index5, <PROCESS>_record, key_to_delete);
<IF_IX6>
<IF_IX6> key_to_delete := upper_case(<PROCESS>_data.<IX6>);
<IF_IX6> deletekey( index6, <PROCESS>_record, key_to_delete);
<IF_IX7>
<IF_IX7> key_to_delete := upper_case(<PROCESS>_data.<IX7>);
<IF_IX7> deletekey( index7, <PROCESS>_record, key_to_delete);
<IF_IX8>
<IF_IX8> key_to_delete := upper_case(<PROCESS>_data.<IX8>);
<IF_IX8> deletekey( index8, <PROCESS>_record, key_to_delete);
<IF_IX9>
<IF_IX9> key_to_delete := upper_case(<PROCESS>_data.<IX9>);
<IF_IX9> deletekey( index9, <PROCESS>_record, key_to_delete);
deleterec( <PROCESS>_file, <PROCESS>_record );
message('Deleted...',1);
<PROCESS>_record := NEW_<PROCESS>;
if usedrecs( <PROCESS>_file ) = 0 then begin
<IF_IX1> clearkey( index1 );
<IF_IX2> clearkey( index2 );
<IF_IX3> clearkey( index3 );
<IF_IX4> clearkey( index4 );
<IF_IX5> clearkey( index5 );
<IF_IX6> clearkey( index6 );
<IF_IX7> clearkey( index7 );
<IF_IX8> clearkey( index8 );
<IF_IX9> clearkey( index9 );
fillchar( <PROCESS>_data, sizeof( <PROCESS>_data ), 0);
<PROCESS>_screen('\2');
message('FILE IS EMPTY',1);
end {if}
else retrieve_<PROCESS>(1);
end; {if}
end; {procedure delete_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure add_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure add_<PROCESS>;
var key_string : medium_string;
recnum : longint;
save_<PROCESS>_record : longint;
key_to_add : medium_string;
begin
save_<PROCESS>_record := <PROCESS>_record;
<PROCESS>_record := NEW_<PROCESS>;
if fill_<PROCESS> = 3 then
<PROCESS>_record := save_<PROCESS>_record
else begin
addrec( <PROCESS>_file, recnum, <PROCESS>_data );
<PROCESS>_record := recnum;
<IF_IX1> key_to_add := upper_case(<PROCESS>_data.<IX1>);
<IF_IX1> addkey( index1, recnum, key_to_add );
<IF_IX2>
<IF_IX2> key_to_add := upper_case(<PROCESS>_data.<IX2>);
<IF_IX2> addkey( index2, recnum, key_to_add );
<IF_IX3>
<IF_IX3> key_to_add := upper_case(<PROCESS>_data.<IX3>);
<IF_IX3> addkey( index3, recnum, key_to_add );
<IF_IX4>
<IF_IX4> key_to_add := upper_case(<PROCESS>_data.<IX4>);
<IF_IX4> addkey( index4, recnum, key_to_add );
<IF_IX5>
<IF_IX5> key_to_add := upper_case(<PROCESS>_data.<IX5>);
<IF_IX5> addkey( index5, recnum, key_to_add );
<IF_IX6>
<IF_IX6> key_to_add := upper_case(<PROCESS>_data.<IX6>);
<IF_IX6> addkey( index6, recnum, key_to_add );
<IF_IX7>
<IF_IX7> key_to_add := upper_case(<PROCESS>_data.<IX7>);
<IF_IX7> addkey( index7, recnum, key_to_add );
<IF_IX8>
<IF_IX8> key_to_add := upper_case(<PROCESS>_data.<IX8>);
<IF_IX8> addkey( index8, recnum, key_to_add );
<IF_IX9>
<IF_IX9> key_to_add := upper_case(<PROCESS>_data.<IX9>);
<IF_IX9> addkey( index9, recnum, key_to_add );
<PROCESS>_screen('\2');
end; {else}
end; {procedure add_<PROCESS>}
{
*-----------------------------------------------------------------------*
procedure edit_<PROCESS>
*-----------------------------------------------------------------------*
}
procedure edit_<PROCESS>;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Allows the user to edit a <PROCESS>.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
var
<IF_IX1> save_<IX1> : medium_string;
<IF_IX2> save_<IX2> : medium_string;
<IF_IX3> save_<IX3> : medium_string;
<IF_IX4> save_<IX4> : medium_string;
<IF_IX5> save_<IX5> : medium_string;
<IF_IX6> save_<IX6> : medium_string;
<IF_IX7> save_<IX7> : medium_string;
<IF_IX8> save_<IX8> : medium_string;
<IF_IX9> save_<IX9> : medium_string;
work_key : medium_string;
begin
if <PROCESS>_record <> NEW_<PROCESS> then begin
<IF_IX1> save_<IX1> := <PROCESS>_data.<IX1>;
<IF_IX2> save_<IX2> := <PROCESS>_data.<IX2>;
<IF_IX3> save_<IX3> := <PROCESS>_data.<IX3>;
<IF_IX4> save_<IX4> := <PROCESS>_data.<IX4>;
<IF_IX5> save_<IX5> := <PROCESS>_data.<IX5>;
<IF_IX6> save_<IX6> := <PROCESS>_data.<IX6>;
<IF_IX7> save_<IX7> := <PROCESS>_data.<IX7>;
<IF_IX8> save_<IX8> := <PROCESS>_data.<IX8>;
<IF_IX9> save_<IX9> := <PROCESS>_data.<IX9>;
if fill_<PROCESS> = 2 then
putrec(<PROCESS>_file, <PROCESS>_record, <PROCESS>_data);
<IF_IX1>if upper_case(save_<IX1>) <> upper_case(<PROCESS>_data.<IX1>) then begin
<IF_IX1> work_key := upper_case( save_<IX1> );
<IF_IX1> deletekey( index1, <PROCESS>_record, work_key );
<IF_IX1> work_key := upper_case( <PROCESS>_data.<IX1> );
<IF_IX1> addkey( index1, <PROCESS>_record, work_key);
<IF_IX1>end; {if}
<IF_IX2>
<IF_IX2>if upper_case(save_<IX2>) <> upper_case(<PROCESS>_data.<IX2>) then begin
<IF_IX2> work_key := upper_case( save_<IX2> );
<IF_IX2> deletekey( index2, <PROCESS>_record, work_key );
<IF_IX2> work_key := upper_case( <PROCESS>_data.<IX2> );
<IF_IX2> addkey( index2, <PROCESS>_record, work_key);
<IF_IX2>end; {if}
<IF_IX3>
<IF_IX3>if upper_case(save_<IX3>) <> upper_case(<PROCESS>_data.<IX3>) then begin
<IF_IX3> work_key := upper_case( save_<IX3> );
<IF_IX3> deletekey( index3, <PROCESS>_record, work_key );
<IF_IX3> work_key := upper_case( <PROCESS>_data.<IX3> );
<IF_IX3> addkey( index3, <PROCESS>_record, work_key);
<IF_IX3>end; {if}
<IF_IX4>
<IF_IX4>if upper_case(save_<IX4>) <> upper_case(<PROCESS>_data.<IX4>) then begin
<IF_IX4> work_key := upper_case( save_<IX4> );
<IF_IX4> deletekey( index4, <PROCESS>_record, work_key );
<IF_IX4> work_key := upper_case( <PROCESS>_data.<IX4> );
<IF_IX4> addkey( index4, <PROCESS>_record, work_key);
<IF_IX4>end; {if}
<IF_IX5>
<IF_IX5>if upper_case(save_<IX5>) <> upper_case(<PROCESS>_data.<IX5>) then begin
<IF_IX5> work_key := upper_case( save_<IX5> );
<IF_IX5> deletekey( index5, <PROCESS>_record, work_key );
<IF_IX5> work_key := upper_case( <PROCESS>_data.<IX5> );
<IF_IX5> addkey( index5, <PROCESS>_record, work_key);
<IF_IX5>end; {if}
<IF_IX6>
<IF_IX6>if upper_case(save_<IX6>) <> upper_case(<PROCESS>_data.<IX6>) then begin
<IF_IX6> work_key := upper_case( save_<IX6> );
<IF_IX6> deletekey( index6, <PROCESS>_record, work_key );
<IF_IX6> work_key := upper_case( <PROCESS>_data.<IX6> );
<IF_IX6> addkey( index6, <PROCESS>_record, work_key);
<IF_IX6>end; {if}
<IF_IX7>
<IF_IX7>if upper_case(save_<IX7>) <> upper_case(<PROCESS>_data.<IX7>) then begin
<IF_IX7> work_key := upper_case( save_<IX7> );
<IF_IX7> deletekey( index7, <PROCESS>_record, work_key );
<IF_IX7> work_key := upper_case( <PROCESS>_data.<IX7> );
<IF_IX7> addkey( index7, <PROCESS>_record, work_key);
<IF_IX7>end; {if}
<IF_IX8>
<IF_IX8>if upper_case(save_<IX8>) <> upper_case(<PROCESS>_data.<IX8>) then begin
<IF_IX8> work_key := upper_case( save_<IX8> );
<IF_IX8> deletekey( index8, <PROCESS>_record, work_key );
<IF_IX8> work_key := upper_case( <PROCESS>_data.<IX8> );
<IF_IX8> addkey( index8, <PROCESS>_record, work_key);
<IF_IX8>end; {if}
<IF_IX9>
<IF_IX9>if upper_case(save_<IX9>) <> upper_case(<PROCESS>_data.<IX9>) then begin
<IF_IX9> work_key := upper_case( save_<IX9> );
<IF_IX9> deletekey( index9, <PROCESS>_record, work_key );
<IF_IX9> work_key := upper_case( <PROCESS>_data.<IX9> );
<IF_IX9> addkey( index9, <PROCESS>_record, work_key);
<IF_IX9>end; {if}
end {if}
else message('Please Select a Record for Editing',2);
end; {procedure edit_<PROCESS>}
{
*---------------------------------------------------------------------*
MAIN CODE FOR procedure maintain_<PROCESS>
*---------------------------------------------------------------------*
}
var select : integer;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Supervisory routine for <PROCESS> maintenance routines.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
begin
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Initialize System and Database.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
set_system;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Show them a blank entry screen.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
<IF_IX1>search_index := <IXLOC1>;
clrscr;
if not open_<PROCESS> then begin
set_cursor(1);
exit;
end; {if}
<PROCESS>_record := NEW_<PROCESS>;
fillchar( <PROCESS>_data, sizeof( <PROCESS>_data ), 0);
<PROCESS>_screen('\1\2');
message('<PROCESS> : Alared Software / 1650 Lexington Avenue / Lakewood, NJ 08701',1);
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Give them the <PROCESS> Menu.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
select := 1;
repeat
select := get_menu( '\1Add\2Edit\3Delete\4Next\5Previous'+
'\6Find\7Quit',
'\1Add Record\2Edit Record\3Delete Record'+
'\6First, Last, Search\7Exit to DOS',
select, '\qOPTION: ');
case select of
1: add_<PROCESS>;
2: edit_<PROCESS>;
3: delete_<PROCESS>;
4: retrieve_<PROCESS>(3);
5: retrieve_<PROCESS>(4);
6: find_<PROCESS>;
7: begin close_<PROCESS>;
clrscr;
gotoxy(homex, endscry);
set_cursor(1);
exit;
end;
end; {case}
until false;
end. {program <PROCESS>}